<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
function getShige() {
	var xhr = new XMLHttpRequest();
	xhr.open("GET", "content.txt");
	xhr.send();
	xhr.onreadystatechange = function() {
		if (xhr.readyState === 4 && xhr.status === 200) {
			document.getElementsByTagName("p")[0].innerHTML = xhr.responseText;
		} else {
			document.getElementsByTagName("p")[0].innerHTML = "<img src='loading.gif'>";
		};
	};
};
window.onload = function() {
	document.getElementsByTagName("button")[0].onclick = function() {
		getShige();
	};
};
</script>
</head>
<body>
<button>再别康桥</button>
<p></p>
</body>
</html>